package com.manage.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * 职位表
 * @TableName position
 */
@TableName(value ="position")
@Data
public class PositionDTO {
    private Integer pageNum;
    private Integer pageSize;
    /**
     * 职位ID
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 职位名
     */
    private String title;

    private Integer parentPosition;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PositionDTO other = (PositionDTO) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
                && (this.getParentPosition() == null ? other.getParentPosition() == null : this.getParentPosition().equals(other.getParentPosition()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getParentPosition() == null) ? 0 : getParentPosition().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", title=").append(title);
        sb.append(", parentPosition=").append(parentPosition);
        sb.append("]");
        return sb.toString();
    }
}